home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / develop™ Technical Journal / develop Issue 28 code / Merge_Tools.sit / Merge Tools / util.c < prev    next >
MacBinary  |  1996-03-05  |  8.3 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Mar 5 11:26:03 1996, modified Tue Mar 5 11:26:03 1996, creator 'MPS ', type ASCII, 7760 bytes "util.c" , at 0x1ed0 428 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-4K) default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 75 74 69 6c 2e 63 | 00 00 00 00 00 00 00 00 |..util.c|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 1e 50 00 | 00 01 ac ad 62 1b 9b ad |......P.|....b...|
|00000060| 62 1b 9b 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |b.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 21 ee 00 00 |........|....!...|
|00000080| 2f 2a 20 53 75 70 70 6f | 72 74 20 72 6f 75 74 69 |/* Suppo|rt routi|
|00000090| 6e 65 73 20 66 6f 72 20 | 45 63 6c 65 63 74 75 73 |nes for |Eclectus|
|000000a0| 20 69 6e 74 65 67 72 61 | 74 69 6f 6e 20 75 74 69 | integra|tion uti|
|000000b0| 6c 69 74 69 65 73 2e 0d | 09 20 43 6f 70 79 72 69 |lities..|. Copyri|
|000000c0| 67 68 74 20 28 43 29 20 | 31 39 39 32 2d 31 39 39 |ght (C) |1992-199|
|000000d0| 36 20 45 63 6c 65 63 74 | 75 73 20 28 44 2e 20 4a |6 Eclect|us (D. J|
|000000e0| 6f 68 6e 20 41 6e 64 65 | 72 73 6f 6e 2c 20 41 6c |ohn Ande|rson, Al|
|000000f0| 61 6e 20 42 2e 20 48 61 | 72 70 65 72 29 2e 0d 0d |an B. Ha|rper)...|
|00000100| 54 68 69 73 20 66 69 6c | 65 20 69 73 20 70 61 72 |This fil|e is par|
|00000110| 74 20 6f 66 20 74 68 65 | 20 45 63 6c 65 63 74 75 |t of the| Eclectu|
|00000120| 73 20 69 6e 74 65 67 72 | 61 74 69 6f 6e 20 75 74 |s integr|ation ut|
|00000130| 69 6c 69 74 69 65 73 2e | 0d 0d 45 63 6c 65 63 74 |ilities.|..Eclect|
|00000140| 75 73 20 69 6e 74 65 67 | 72 61 74 69 6f 6e 20 75 |us integ|ration u|
|00000150| 74 69 6c 69 74 69 65 73 | 20 61 72 65 20 66 72 65 |tilities| are fre|
|00000160| 65 20 73 6f 66 74 77 61 | 72 65 3b 20 79 6f 75 20 |e softwa|re; you |
|00000170| 63 61 6e 20 72 65 64 69 | 73 74 72 69 62 75 74 65 |can redi|stribute|
|00000180| 0d 69 74 20 61 6e 64 2f | 6f 72 20 6d 6f 64 69 66 |.it and/|or modif|
|00000190| 79 20 69 74 20 75 6e 64 | 65 72 20 74 68 65 20 74 |y it und|er the t|
|000001a0| 65 72 6d 73 20 6f 66 20 | 74 68 65 20 47 4e 55 20 |erms of |the GNU |
|000001b0| 47 65 6e 65 72 61 6c 20 | 50 75 62 6c 69 63 20 4c |General |Public L|
|000001c0| 69 63 65 6e 73 65 0d 61 | 73 20 70 75 62 6c 69 73 |icense.a|s publis|
|000001d0| 68 65 64 20 62 79 20 74 | 68 65 20 46 72 65 65 20 |hed by t|he Free |
|000001e0| 53 6f 66 74 77 61 72 65 | 20 46 6f 75 6e 64 61 74 |Software| Foundat|
|000001f0| 69 6f 6e 3b 20 65 69 74 | 68 65 72 20 76 65 72 73 |ion; eit|her vers|
|00000200| 69 6f 6e 20 31 2c 20 6f | 72 0d 28 61 74 20 79 6f |ion 1, o|r.(at yo|
|00000210| 75 72 20 6f 70 74 69 6f | 6e 29 20 61 6e 79 20 6c |ur optio|n) any l|
|00000220| 61 74 65 72 20 76 65 72 | 73 69 6f 6e 2e 0d 0d 45 |ater ver|sion...E|
|00000230| 63 6c 65 63 74 75 73 20 | 69 6e 74 65 67 72 61 74 |clectus |integrat|
|00000240| 69 6f 6e 20 75 74 69 6c | 69 74 69 65 73 20 69 73 |ion util|ities is|
|00000250| 20 64 69 73 74 72 69 62 | 75 74 65 64 20 69 6e 20 | distrib|uted in |
|00000260| 74 68 65 20 68 6f 70 65 | 20 74 68 61 74 20 69 74 |the hope| that it|
|00000270| 0d 77 69 6c 6c 20 62 65 | 20 75 73 65 66 75 6c 2c |.will be| useful,|
|00000280| 20 62 75 74 20 57 49 54 | 48 4f 55 54 20 41 4e 59 | but WIT|HOUT ANY|
|00000290| 20 57 41 52 52 41 4e 54 | 59 3b 20 77 69 74 68 6f | WARRANT|Y; witho|
|000002a0| 75 74 20 65 76 65 6e 20 | 74 68 65 20 69 6d 70 6c |ut even |the impl|
|000002b0| 69 65 64 0d 77 61 72 72 | 61 6e 74 79 20 6f 66 20 |ied.warr|anty of |
|000002c0| 4d 45 52 43 48 41 4e 54 | 41 42 49 4c 49 54 59 20 |MERCHANT|ABILITY |
|000002d0| 6f 72 20 46 49 54 4e 45 | 53 53 20 46 4f 52 20 41 |or FITNE|SS FOR A|
|000002e0| 20 50 41 52 54 49 43 55 | 4c 41 52 20 50 55 52 50 | PARTICU|LAR PURP|
|000002f0| 4f 53 45 2e 0d 53 65 65 | 20 74 68 65 20 47 4e 55 |OSE..See| the GNU|
|00000300| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00000310| 4c 69 63 65 6e 73 65 20 | 66 6f 72 20 6d 6f 72 65 |License |for more|
|00000320| 20 64 65 74 61 69 6c 73 | 2e 0d 0d 59 6f 75 20 73 | details|...You s|
|00000330| 68 6f 75 6c 64 20 68 61 | 76 65 20 72 65 63 65 69 |hould ha|ve recei|
|00000340| 76 65 64 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |ved a co|py of th|
|00000350| 65 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 |e GNU Ge|neral Pu|
|00000360| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 0d 61 6c 6f |blic Lic|ense.alo|
|00000370| 6e 67 20 77 69 74 68 20 | 74 68 65 20 45 63 6c 65 |ng with |the Ecle|
|00000380| 63 74 75 73 20 69 6e 74 | 65 67 72 61 74 69 6f 6e |ctus int|egration|
|00000390| 20 75 74 69 6c 69 74 69 | 65 73 3b 20 73 65 65 20 | utiliti|es; see |
|000003a0| 74 68 65 20 66 69 6c 65 | 20 43 4f 50 59 49 4e 47 |the file| COPYING|
|000003b0| 2e 0d 49 66 20 6e 6f 74 | 2c 20 77 72 69 74 65 20 |..If not|, write |
|000003c0| 74 6f 20 74 68 65 20 46 | 72 65 65 20 53 6f 66 74 |to the F|ree Soft|
|000003d0| 77 61 72 65 20 46 6f 75 | 6e 64 61 74 69 6f 6e 2c |ware Fou|ndation,|
|000003e0| 20 36 37 35 20 4d 61 73 | 73 20 41 76 65 2c 20 43 | 675 Mas|s Ave, C|
|000003f0| 61 6d 62 72 69 64 67 65 | 2c 0d 4d 41 20 30 32 31 |ambridge|,.MA 021|
|00000400| 33 39 2c 20 55 53 41 2e | 09 2a 2f 0d 0d 23 69 6e |39, USA.|.*/..#in|
|00000410| 63 6c 75 64 65 20 22 64 | 69 66 66 2e 68 22 0d 23 |clude "d|iff.h".#|
|00000420| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 6c 69 62 2e |include |<stdlib.|
|00000430| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 73 74 72 |h>.#incl|ude <str|
|00000440| 69 6e 67 2e 68 3e 0d 23 | 69 66 64 65 66 20 44 46 |ing.h>.#|ifdef DF|
|00000450| 5f 4d 41 43 48 49 4e 45 | 5f 4d 41 43 49 4e 54 4f |_MACHINE|_MACINTO|
|00000460| 53 48 0d 09 23 69 6e 63 | 6c 75 64 65 20 3c 54 79 |SH..#inc|lude <Ty|
|00000470| 70 65 73 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 0d 23 |pes.h>.#|endif..#|
|00000480| 69 66 64 65 66 20 44 46 | 5f 4d 41 43 48 49 4e 45 |ifdef DF|_MACHINE|
|00000490| 5f 4e 45 58 54 0d 2f 2a | 0d 09 23 69 6e 63 6c 75 |_NEXT./*|..#inclu|
|000004a0| 64 65 20 3c 2f 75 73 72 | 2f 69 6e 63 6c 75 64 65 |de </usr|/include|
|000004b0| 2f 73 79 73 2f 70 61 72 | 61 6d 2e 68 3e 0d 2a 2f |/sys/par|am.h>.*/|
|000004c0| 0d 23 65 6e 64 69 66 0d | 0d 63 6f 6e 73 74 20 63 |.#endif.|.const c|
|000004d0| 68 61 72 09 2a 45 43 4d | 65 73 73 61 67 65 73 73 |har.*ECM|essagess|
|000004e0| 41 72 72 61 79 20 5b 4d | 41 58 5f 45 52 52 4f 52 |Array [M|AX_ERROR|
|000004f0| 5f 4b 49 4e 44 20 2b 20 | 31 5d 20 3d 20 7b 0d 09 |_KIND + |1] = {..|
|00000500| 22 49 6e 63 6f 6d 70 61 | 74 69 62 6c 65 20 73 63 |"Incompa|tible sc|
|00000510| 72 69 70 74 20 76 65 72 | 73 69 6f 6e 20 6f 72 20 |ript ver|sion or |
|00000520| 62 61 64 20 73 63 72 69 | 70 74 20 66 69 6c 65 22 |bad scri|pt file"|
|00000530| 2c 0d 09 22 42 61 64 20 | 73 63 72 69 70 74 20 66 |,.."Bad |script f|
|00000540| 69 6c 65 20 6f 72 20 73 | 6f 75 72 63 65 20 70 61 |ile or s|ource pa|
|00000550| 74 68 22 2c 0d 09 22 43 | 61 6e 27 74 20 63 72 65 |th",.."C|an't cre|
|00000560| 61 74 65 20 74 68 65 20 | 64 69 72 65 63 74 6f 72 |ate the |director|
|00000570| 79 20 5c 22 25 73 5c 22 | 22 2c 0d 09 22 43 61 6e |y \"%s\"|",.."Can|
|00000580| 27 74 20 63 72 65 61 74 | 65 20 74 68 65 20 66 69 |'t creat|e the fi|
|00000590| 6c 65 20 5c 22 25 73 5c | 22 22 2c 0d 09 22 43 61 |le \"%s\|"",.."Ca|
|000005a0| 6e 27 74 20 6f 70 65 6e | 20 66 69 6c 65 20 25 73 |n't open| file %s|
|000005b0| 22 2c 0d 09 22 48 41 53 | 48 20 45 52 52 4f 52 21 |",.."HAS|H ERROR!|
|000005c0| 20 20 54 68 65 20 66 69 | 6c 65 20 6d 61 79 20 62 | The fi|le may b|
|000005d0| 65 20 63 6f 72 72 75 70 | 74 65 64 2e 22 2c 0d 09 |e corrup|ted.",..|
|000005e0| 22 4f 75 74 20 6f 66 20 | 6d 65 6d 6f 72 79 22 2c |"Out of |memory",|
|000005f0| 0d 09 22 59 6f 75 20 63 | 61 6e 27 74 20 6d 65 72 |.."You c|an't mer|
|00000600| 67 65 20 66 69 6c 65 73 | 20 6f 72 20 64 69 72 65 |ge files| or dire|
|00000610| 63 74 6f 72 69 65 73 20 | 77 69 74 68 20 74 68 65 |ctories |with the|
|00000620| 20 73 61 6d 65 20 6e 61 | 6d 65 20 6f 66 20 64 69 | same na|me of di|
|00000630| 66 66 65 72 65 6e 74 20 | 74 79 70 65 73 22 2c 0d |fferent |types",.|
|00000640| 09 22 41 20 6e 6f 6e 20 | 41 53 43 49 49 20 63 68 |."A non |ASCII ch|
|00000650| 61 72 61 63 74 65 72 20 | 77 61 73 20 66 6f 75 6e |aracter |was foun|
|00000660| 64 22 2c 0d 09 22 50 61 | 74 68 20 74 6f 6f 20 6c |d",.."Pa|th too l|
|00000670| 6f 6e 67 2e 20 20 53 68 | 6f 72 74 65 6e 20 70 61 |ong. Sh|orten pa|
|00000680| 74 68 73 20 6f 72 20 65 | 6c 69 6d 69 6e 61 74 65 |ths or e|liminate|
|00000690| 20 64 69 72 65 63 74 6f | 72 69 65 73 22 2c 0d 09 | directo|ries",..|
|000006a0| 22 59 6f 75 20 6d 75 73 | 74 20 73 70 65 63 69 66 |"You mus|t specif|
|000006b0| 79 20 74 68 72 65 65 20 | 6f 72 20 6d 6f 72 65 20 |y three |or more |
|000006c0| 70 61 74 68 73 3a 20 6f | 6e 65 20 72 6f 6f 74 20 |paths: o|ne root |
|000006d0| 66 6f 6c 6c 6f 77 65 64 | 20 62 79 20 74 77 6f 20 |followed| by two |
|000006e0| 6f 72 20 6d 6f 72 65 20 | 64 65 72 69 76 65 64 20 |or more |derived |
|000006f0| 74 6f 20 6d 65 72 67 65 | 20 69 6e 74 6f 20 74 68 |to merge| into th|
|00000700| 65 20 72 6f 6f 74 22 2c | 0d 09 22 59 6f 75 20 6d |e root",|.."You m|
|00000710| 75 73 74 20 73 70 65 63 | 69 66 79 20 74 68 72 65 |ust spec|ify thre|
|00000720| 65 20 70 61 74 68 73 3a | 20 6f 6e 65 20 73 6f 75 |e paths:| one sou|
|00000730| 72 63 65 20 70 61 74 68 | 2c 20 6f 6e 65 20 44 69 |rce path|, one Di|
|00000740| 66 66 65 72 65 6e 63 65 | 20 73 63 72 69 70 74 20 |fference| script |
|00000750| 70 61 74 68 20 61 6e 64 | 20 6f 6e 65 20 64 65 73 |path and| one des|
|00000760| 74 69 6e 61 74 69 6f 6e | 20 70 61 74 68 22 2c 0d |tination| path",.|
|00000770| 09 22 59 6f 75 20 6d 75 | 73 74 20 73 70 65 63 69 |."You mu|st speci|
|00000780| 66 79 20 74 77 6f 20 70 | 61 74 68 73 20 74 6f 20 |fy two p|aths to |
|00000790| 63 6f 6d 70 61 72 65 22 | 2c 0d 09 22 55 6e 65 78 |compare"|,.."Unex|
|000007a0| 70 65 63 74 65 64 20 49 | 4f 20 45 72 72 6f 72 20 |pected I|O Error |
|000007b0| 6f 6e 20 66 69 6c 65 20 | 5c 22 25 73 5c 22 22 2c |on file |\"%s\"",|
|000007c0| 0d 09 22 55 6e 65 78 70 | 65 63 74 65 64 20 6f 70 |.."Unexp|ected op|
|000007d0| 74 69 6f 6e 20 6f 6e 20 | 63 6f 6d 6d 61 6e 64 20 |tion on |command |
|000007e0| 6c 69 6e 65 3a 20 5c 22 | 25 73 5c 22 22 0d 09 7d |line: \"|%s\""..}|
|000007f0| 3b 0d 0d 2f 2a 20 4c 6f | 6f 6b 20 61 74 20 61 20 |;../* Lo|ok at a |
|00000800| 68 75 6e 6b 20 6f 66 20 | 65 64 69 74 20 73 63 72 |hunk of |edit scr|
|00000810| 69 70 74 20 61 6e 64 20 | 72 65 70 6f 72 74 20 74 |ipt and |report t|
|00000820| 68 65 20 72 61 6e 67 65 | 20 6f 66 20 6c 69 6e 65 |he range| of line|
|00000830| 73 20 69 6e 20 65 61 63 | 68 20 66 69 6c 65 0d 09 |s in eac|h file..|
|00000840| 20 74 68 61 74 20 69 74 | 20 61 70 70 6c 69 65 73 | that it| applies|
|00000850| 20 74 6f 2e 09 48 55 4e | 4b 20 69 73 20 74 68 65 | to..HUN|K is the|
|00000860| 20 73 74 61 72 74 20 6f | 66 20 74 68 65 20 68 75 | start o|f the hu|
|00000870| 6e 6b 2c 20 77 68 69 63 | 68 20 69 73 20 61 20 63 |nk, whic|h is a c|
|00000880| 68 61 69 6e 0d 09 20 6f | 66 20 60 73 74 72 75 63 |hain.. o|f `struc|
|00000890| 74 20 63 68 61 6e 67 65 | 27 2e 20 20 54 68 65 20 |t change|'. The |
|000008a0| 66 69 72 73 74 20 61 6e | 64 20 6c 61 73 74 20 6c |first an|d last l|
|000008b0| 69 6e 65 20 6e 75 6d 62 | 65 72 73 20 6f 66 20 66 |ine numb|ers of f|
|000008c0| 69 6c 65 20 30 20 61 72 | 65 20 73 74 6f 72 65 64 |ile 0 ar|e stored|
|000008d0| 20 69 6e 0d 09 20 2a 46 | 49 52 53 54 30 20 61 6e | in.. *F|IRST0 an|
|000008e0| 64 20 2a 4c 41 53 54 30 | 2c 20 61 6e 64 20 6c 69 |d *LAST0|, and li|
|000008f0| 6b 65 77 69 73 65 20 66 | 6f 72 20 66 69 6c 65 20 |kewise f|or file |
|00000900| 31 20 69 6e 20 2a 46 49 | 52 53 54 31 20 61 6e 64 |1 in *FI|RST1 and|
|00000910| 20 2a 4c 41 53 54 31 2e | 20 0d 09 20 4e 6f 74 65 | *LAST1.| .. Note|
|00000920| 20 74 68 61 74 20 74 68 | 65 73 65 20 61 72 65 20 | that th|ese are |
|00000930| 69 6e 74 65 72 6e 61 6c | 20 6c 69 6e 65 20 6e 75 |internal| line nu|
|00000940| 6d 62 65 72 73 20 74 68 | 61 74 20 63 6f 75 6e 74 |mbers th|at count|
|00000950| 20 66 72 6f 6d 20 30 2e | 0d 0d 09 20 49 66 20 6e | from 0.|... If n|
|00000960| 6f 20 6c 69 6e 65 73 20 | 66 72 6f 6d 20 66 69 6c |o lines |from fil|
|00000970| 65 20 30 20 61 72 65 20 | 64 65 6c 65 74 65 64 2c |e 0 are |deleted,|
|00000980| 20 74 68 65 6e 20 46 49 | 52 53 54 30 20 69 73 20 | then FI|RST0 is |
|00000990| 4c 41 53 54 30 2b 31 2e | 0d 0d 09 20 41 6c 73 6f |LAST0+1.|... Also|
|000009a0| 20 73 65 74 20 2a 44 45 | 4c 45 54 45 53 20 6e 6f | set *DE|LETES no|
|000009b0| 6e 7a 65 72 6f 20 69 66 | 20 61 6e 79 20 6c 69 6e |nzero if| any lin|
|000009c0| 65 73 20 6f 66 20 66 69 | 6c 65 20 30 20 61 72 65 |es of fi|le 0 are|
|000009d0| 20 64 65 6c 65 74 65 64 | 0d 09 20 61 6e 64 20 73 | deleted|.. and s|
|000009e0| 65 74 20 2a 49 4e 53 45 | 52 54 53 20 6e 6f 6e 7a |et *INSE|RTS nonz|
|000009f0| 65 72 6f 20 69 66 20 61 | 6e 79 20 6c 69 6e 65 73 |ero if a|ny lines|
|00000a00| 20 6f 66 20 66 69 6c 65 | 20 31 20 61 72 65 20 69 | of file| 1 are i|
|00000a10| 6e 73 65 72 74 65 64 2e | 0d 09 20 49 66 20 6f 6e |nserted.|.. If on|
|00000a20| 6c 79 20 69 67 6e 6f 72 | 61 62 6c 65 20 6c 69 6e |ly ignor|able lin|
|00000a30| 65 73 20 61 72 65 20 69 | 6e 73 65 72 74 65 64 20 |es are i|nserted |
|00000a40| 6f 72 20 64 65 6c 65 74 | 65 64 2c 20 62 6f 74 68 |or delet|ed, both|
|00000a50| 20 61 72 65 0d 09 20 73 | 65 74 20 74 6f 20 30 2e | are.. s|et to 0.|
|00000a60| 09 2a 2f 0d 0d 76 6f 69 | 64 0d 41 70 70 65 6e 64 |.*/..voi|d.Append|
|00000a70| 43 68 61 72 54 6f 50 61 | 74 68 4e 61 6d 65 20 28 |CharToPa|thName (|
|00000a80| 63 68 61 72 20 2a 64 65 | 73 74 69 6e 61 74 69 6f |char *de|stinatio|
|00000a90| 6e 43 68 61 72 50 74 72 | 2c 20 63 6f 6e 73 74 20 |nCharPtr|, const |
|00000aa0| 63 68 61 72 20 74 68 65 | 43 68 61 72 29 0d 7b 0d |char the|Char).{.|
|00000ab0| 09 69 6e 74 20 64 65 73 | 74 69 6e 61 74 69 6f 6e |.int des|tination|
|00000ac0| 4c 65 6e 67 74 68 3b 0d | 0d 09 64 65 73 74 69 6e |Length;.|..destin|
|00000ad0| 61 74 69 6f 6e 4c 65 6e | 67 74 68 20 3d 20 73 74 |ationLen|gth = st|
|00000ae0| 72 6c 65 6e 20 28 64 65 | 73 74 69 6e 61 74 69 6f |rlen (de|stinatio|
|00000af0| 6e 43 68 61 72 50 74 72 | 29 3b 0d 09 69 66 20 28 |nCharPtr|);..if (|
|00000b00| 64 65 73 74 69 6e 61 74 | 69 6f 6e 4c 65 6e 67 74 |destinat|ionLengt|
|00000b10| 68 20 2b 20 31 20 3e 20 | 46 49 4c 45 4e 41 4d 45 |h + 1 > |FILENAME|
|00000b20| 5f 4d 41 58 29 20 7b 0d | 09 09 66 70 72 69 6e 74 |_MAX) {.|..fprint|
|00000b30| 66 20 28 73 74 64 65 72 | 72 2c 20 22 25 73 25 63 |f (stder|r, "%s%c|
|00000b40| 5c 6e 22 2c 20 64 65 73 | 74 69 6e 61 74 69 6f 6e |\n", des|tination|
|00000b50| 43 68 61 72 50 74 72 2c | 20 74 68 65 43 68 61 72 |CharPtr,| theChar|
|00000b60| 29 3b 0d 09 09 45 72 72 | 6f 72 20 28 50 41 54 48 |);...Err|or (PATH|
|00000b70| 5f 54 4f 4f 5f 4c 4f 4e | 47 29 3b 0d 09 7d 0d 09 |_TOO_LON|G);..}..|
|00000b80| 64 65 73 74 69 6e 61 74 | 69 6f 6e 43 68 61 72 50 |destinat|ionCharP|
|00000b90| 74 72 20 2b 3d 20 64 65 | 73 74 69 6e 61 74 69 6f |tr += de|stinatio|
|00000ba0| 6e 4c 65 6e 67 74 68 3b | 0d 09 2a 64 65 73 74 69 |nLength;|..*desti|
|00000bb0| 6e 61 74 69 6f 6e 43 68 | 61 72 50 74 72 2b 2b 20 |nationCh|arPtr++ |
|00000bc0| 3d 20 74 68 65 43 68 61 | 72 3b 0d 09 2a 64 65 73 |= theCha|r;..*des|
|00000bd0| 74 69 6e 61 74 69 6f 6e | 43 68 61 72 50 74 72 20 |tination|CharPtr |
|00000be0| 3d 20 27 5c 30 27 3b 0d | 7d 0d 0d 76 6f 69 64 0d |= '\0';.|}..void.|
|00000bf0| 41 70 70 65 6e 64 53 74 | 72 69 6e 67 54 6f 50 61 |AppendSt|ringToPa|
|00000c00| 74 68 4e 61 6d 65 20 28 | 63 68 61 72 20 2a 64 65 |thName (|char *de|
|00000c10| 73 74 69 6e 61 74 69 6f | 6e 43 68 61 72 50 74 72 |stinatio|nCharPtr|
|00000c20| 2c 20 63 6f 6e 73 74 20 | 63 68 61 72 20 2a 73 75 |, const |char *su|
|00000c30| 66 66 69 78 43 68 61 72 | 50 74 72 29 0d 7b 0d 09 |ffixChar|Ptr).{..|
|00000c40| 69 6e 74 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 4c |int dest|inationL|
|00000c50| 65 6e 67 74 68 3b 0d 09 | 69 6e 74 20 73 75 66 66 |ength;..|int suff|
|00000c60| 69 78 4c 65 6e 67 74 68 | 3b 0d 0d 09 64 65 73 74 |ixLength|;...dest|
|00000c70| 69 6e 61 74 69 6f 6e 4c | 65 6e 67 74 68 20 3d 20 |inationL|ength = |
|00000c80| 73 74 72 6c 65 6e 20 28 | 64 65 73 74 69 6e 61 74 |strlen (|destinat|
|00000c90| 69 6f 6e 43 68 61 72 50 | 74 72 29 3b 0d 09 73 75 |ionCharP|tr);..su|
|00000ca0| 66 66 69 78 4c 65 6e 67 | 74 68 20 3d 20 73 74 72 |ffixLeng|th = str|
|00000cb0| 6c 65 6e 20 28 73 75 66 | 66 69 78 43 68 61 72 50 |len (suf|fixCharP|
|00000cc0| 74 72 29 3b 0d 09 69 66 | 20 28 64 65 73 74 69 6e |tr);..if| (destin|
|00000cd0| 61 74 69 6f 6e 4c 65 6e | 67 74 68 20 2b 20 73 75 |ationLen|gth + su|
|00000ce0| 66 66 69 78 4c 65 6e 67 | 74 68 20 3e 20 46 49 4c |ffixLeng|th > FIL|
|00000cf0| 45 4e 41 4d 45 5f 4d 41 | 58 29 20 7b 0d 09 09 66 |ENAME_MA|X) {...f|
|00000d00| 70 72 69 6e 74 66 20 28 | 73 74 64 65 72 72 2c 20 |printf (|stderr, |
|00000d10| 22 25 73 25 73 5c 6e 22 | 2c 20 64 65 73 74 69 6e |"%s%s\n"|, destin|
|00000d20| 61 74 69 6f 6e 43 68 61 | 72 50 74 72 2c 20 73 75 |ationCha|rPtr, su|
|00000d30| 66 66 69 78 43 68 61 72 | 50 74 72 29 3b 0d 09 09 |ffixChar|Ptr);...|
|00000d40| 45 72 72 6f 72 20 28 50 | 41 54 48 5f 54 4f 4f 5f |Error (P|ATH_TOO_|
|00000d50| 4c 4f 4e 47 29 3b 0d 09 | 7d 0d 09 28 76 6f 69 64 |LONG);..|}..(void|
|00000d60| 29 20 6d 65 6d 63 70 79 | 20 28 64 65 73 74 69 6e |) memcpy| (destin|
|00000d70| 61 74 69 6f 6e 43 68 61 | 72 50 74 72 20 2b 20 64 |ationCha|rPtr + d|
|00000d80| 65 73 74 69 6e 61 74 69 | 6f 6e 4c 65 6e 67 74 68 |estinati|onLength|
|00000d90| 2c 20 73 75 66 66 69 78 | 43 68 61 72 50 74 72 2c |, suffix|CharPtr,|
|00000da0| 20 73 75 66 66 69 78 4c | 65 6e 67 74 68 20 2b 20 | suffixL|ength + |
|00000db0| 31 29 3b 0d 7d 0d 0d 76 | 6f 69 64 0d 45 72 72 6f |1);.}..v|oid.Erro|
|00000dc0| 72 20 28 69 6e 74 20 65 | 72 72 6f 72 4b 69 6e 64 |r (int e|rrorKind|
|00000dd0| 29 0d 7b 0d 09 45 72 72 | 6f 72 57 69 74 68 53 74 |).{..Err|orWithSt|
|00000de0| 72 69 6e 67 41 72 67 75 | 6d 65 6e 74 20 28 65 72 |ringArgu|ment (er|
|00000df0| 72 6f 72 4b 69 6e 64 2c | 20 4e 55 4c 4c 29 3b 0d |rorKind,| NULL);.|
|00000e00| 7d 0d 0d 76 6f 69 64 0d | 45 72 72 6f 72 57 69 74 |}..void.|ErrorWit|
|00000e10| 68 53 74 72 69 6e 67 41 | 72 67 75 6d 65 6e 74 20 |hStringA|rgument |
|00000e20| 28 69 6e 74 20 65 72 72 | 6f 72 4b 69 6e 64 2c 20 |(int err|orKind, |
|00000e30| 63 6f 6e 73 74 20 63 68 | 61 72 20 2a 61 72 67 75 |const ch|ar *argu|
|00000e40| 6d 65 6e 74 53 74 72 69 | 6e 67 50 74 72 29 0d 7b |mentStri|ngPtr).{|
|00000e50| 0d 09 69 66 20 28 61 72 | 67 75 6d 65 6e 74 53 74 |..if (ar|gumentSt|
|00000e60| 72 69 6e 67 50 74 72 20 | 3d 3d 20 4e 55 4c 4c 29 |ringPtr |== NULL)|
|00000e70| 0d 09 09 66 70 72 69 6e | 74 66 20 28 73 74 64 65 |...fprin|tf (stde|
|00000e80| 72 72 2c 20 45 43 4d 65 | 73 73 61 67 65 73 73 41 |rr, ECMe|ssagessA|
|00000e90| 72 72 61 79 5b 65 72 72 | 6f 72 4b 69 6e 64 5d 2c |rray[err|orKind],|
|00000ea0| 20 22 4e 75 6c 6c 20 50 | 6f 69 6e 74 65 72 22 29 | "Null P|ointer")|
|00000eb0| 3b 0d 09 65 6c 73 65 0d | 09 09 66 70 72 69 6e 74 |;..else.|..fprint|
|00000ec0| 66 20 28 73 74 64 65 72 | 72 2c 20 45 43 4d 65 73 |f (stder|r, ECMes|
|00000ed0| 73 61 67 65 73 73 41 72 | 72 61 79 5b 65 72 72 6f |sagessAr|ray[erro|
|00000ee0| 72 4b 69 6e 64 5d 2c 20 | 61 72 67 75 6d 65 6e 74 |rKind], |argument|
|00000ef0| 53 74 72 69 6e 67 50 74 | 72 29 3b 0d 09 66 70 72 |StringPt|r);..fpr|
|00000f00| 69 6e 74 66 20 28 73 74 | 64 65 72 72 2c 20 22 2e |intf (st|derr, ".|
|00000f10| 5c 6e 22 29 3b 0d 09 65 | 78 69 74 20 28 45 58 49 |\n");..e|xit (EXI|
|00000f20| 54 5f 46 41 49 4c 55 52 | 45 29 3b 0d 7d 0d 0d 2f |T_FAILUR|E);.}../|
|00000f30| 2a 20 43 6f 6d 70 61 72 | 65 20 74 77 6f 20 6c 69 |* Compar|e two li|
|00000f40| 6e 65 73 2e 0d 09 20 45 | 61 63 68 20 6c 69 6e 65 |nes... E|ach line|
|00000f50| 20 69 73 20 64 65 73 63 | 72 69 62 65 64 20 62 79 | is desc|ribed by|
|00000f60| 20 61 20 60 73 74 72 75 | 63 74 20 6c 69 6e 65 5f | a `stru|ct line_|
|00000f70| 64 65 66 27 2e 0d 09 20 | 52 65 74 75 72 6e 20 31 |def'... |Return 1|
|00000f80| 20 69 66 20 74 68 65 20 | 6c 69 6e 65 73 20 64 69 | if the |lines di|
|00000f90| 66 66 65 72 2c 20 6c 69 | 6b 65 20 60 62 63 6d 70 |ffer, li|ke `bcmp|
|00000fa0| 27 2e 20 20 2a 2f 0d 0d | 69 6e 74 0d 6c 69 6e 65 |'. */..|int.line|
|00000fb0| 5f 63 6d 70 20 28 73 74 | 72 75 63 74 20 6c 69 6e |_cmp (st|ruct lin|
|00000fc0| 65 5f 64 65 66 20 2a 73 | 31 2c 20 73 74 72 75 63 |e_def *s|1, struc|
|00000fd0| 74 20 6c 69 6e 65 5f 64 | 65 66 20 2a 73 32 29 0d |t line_d|ef *s2).|
|00000fe0| 7b 0d 09 72 65 67 69 73 | 74 65 72 09 63 68 61 72 |{..regis|ter.char|
|00000ff0| 20 2a 74 31 2c 20 2a 74 | 32 3b 0d 09 63 68 61 72 | *t1, *t|2;..char|
|00001000| 09 09 09 73 61 76 65 63 | 68 61 72 3b 0d 0d 09 74 |...savec|har;...t|
|00001010| 31 20 3d 20 73 31 2d 3e | 74 65 78 74 3b 0d 09 74 |1 = s1->|text;..t|
|00001020| 32 20 3d 20 73 32 2d 3e | 74 65 78 74 3b 0d 0d 09 |2 = s2->|text;...|
|00001030| 2f 2a 20 41 6c 74 65 72 | 20 74 68 65 20 63 68 61 |/* Alter| the cha|
|00001040| 72 61 63 74 65 72 20 66 | 6f 6c 6c 6f 77 69 6e 67 |racter f|ollowing|
|00001050| 20 6c 69 6e 65 20 32 20 | 73 6f 20 69 74 20 64 6f | line 2 |so it do|
|00001060| 65 73 6e 27 74 0d 09 09 | 20 6d 61 74 63 68 20 74 |esn't...| match t|
|00001070| 68 61 74 20 66 6f 6c 6c | 6f 77 69 6e 67 20 6c 69 |hat foll|owing li|
|00001080| 6e 65 20 31 2e 0d 09 09 | 20 28 57 65 20 75 73 65 |ne 1....| (We use|
|00001090| 64 20 74 6f 20 61 6c 74 | 65 72 20 74 68 65 20 63 |d to alt|er the c|
|000010a0| 68 61 72 61 63 74 65 72 | 20 61 66 74 65 72 20 6c |haracter| after l|
|000010b0| 69 6e 65 20 31 2c 0d 09 | 09 20 62 75 74 20 74 68 |ine 1,..|. but th|
|000010c0| 61 74 20 63 61 75 73 65 | 64 20 74 72 6f 75 62 6c |at cause|d troubl|
|000010d0| 65 20 69 66 20 6c 69 6e | 65 20 32 20 64 69 72 65 |e if lin|e 2 dire|
|000010e0| 63 74 6c 79 20 66 6f 6c | 6c 6f 77 73 20 6c 69 6e |ctly fol|lows lin|
|000010f0| 65 20 31 2e 29 09 2a 2f | 0d 09 73 61 76 65 63 68 |e 1.).*/|..savech|
|00001100| 61 72 20 3d 20 73 32 2d | 3e 74 65 78 74 5b 73 32 |ar = s2-|>text[s2|
|00001110| 2d 3e 6c 65 6e 67 74 68 | 5d 3b 0d 09 73 32 2d 3e |->length|];..s2->|
|00001120| 74 65 78 74 5b 73 32 2d | 3e 6c 65 6e 67 74 68 5d |text[s2-|>length]|
|00001130| 20 3d 20 28 63 68 61 72 | 29 20 28 73 31 2d 3e 74 | = (char|) (s1->t|
|00001140| 65 78 74 5b 73 31 2d 3e | 6c 65 6e 67 74 68 5d 20 |ext[s1->|length] |
|00001150| 2b 20 31 29 3b 0d 0d 09 | 2f 2a 20 4e 6f 77 20 66 |+ 1);...|/* Now f|
|00001160| 69 6e 64 20 74 68 65 20 | 66 69 72 73 74 20 6d 69 |ind the |first mi|
|00001170| 73 6d 61 74 63 68 3b 20 | 74 68 69 73 20 77 6f 6e |smatch; |this won|
|00001180| 27 74 20 67 6f 20 70 61 | 73 74 20 74 68 65 0d 09 |'t go pa|st the..|
|00001190| 09 20 63 68 61 72 61 63 | 74 65 72 20 77 65 20 6a |. charac|ter we j|
|000011a0| 75 73 74 20 63 68 61 6e | 67 65 64 2e 20 20 2a 2f |ust chan|ged. */|
|000011b0| 0d 09 23 69 66 64 65 66 | 20 44 46 5f 43 4f 4d 50 |..#ifdef| DF_COMP|
|000011c0| 49 4c 45 52 5f 4d 57 0d | 09 09 23 70 72 61 67 6d |ILER_MW.|..#pragm|
|000011d0| 61 20 77 61 72 6e 5f 70 | 6f 73 73 75 6e 77 61 6e |a warn_p|ossunwan|
|000011e0| 74 20 6f 66 66 0d 09 23 | 65 6e 64 69 66 0d 0d 09 |t off..#|endif...|
|000011f0| 77 68 69 6c 65 20 28 2a | 74 31 2b 2b 20 3d 3d 20 |while (*|t1++ == |
|00001200| 2a 74 32 2b 2b 29 3b 0d | 0d 09 23 69 66 64 65 66 |*t2++);.|..#ifdef|
|00001210| 20 44 46 5f 43 4f 4d 50 | 49 4c 45 52 5f 4d 57 0d | DF_COMP|ILER_MW.|
|00001220| 09 09 23 70 72 61 67 6d | 61 20 77 61 72 6e 5f 70 |..#pragm|a warn_p|
|00001230| 6f 73 73 75 6e 77 61 6e | 74 20 72 65 73 65 74 0d |ossunwan|t reset.|
|00001240| 09 23 65 6e 64 69 66 0d | 09 2f 2a 20 55 6e 64 6f |.#endif.|./* Undo|
|00001250| 20 74 68 65 20 61 6c 74 | 65 72 61 74 69 6f 6e 2e | the alt|eration.|
|00001260| 20 20 2a 2f 0d 09 73 32 | 2d 3e 74 65 78 74 5b 73 | */..s2|->text[s|
|00001270| 32 2d 3e 6c 65 6e 67 74 | 68 5d 20 3d 20 73 61 76 |2->lengt|h] = sav|
|00001280| 65 63 68 61 72 3b 0d 0d | 09 2f 2a 20 49 66 20 74 |echar;..|./* If t|
|00001290| 68 65 20 63 6f 6d 70 61 | 72 69 73 6f 6e 20 73 74 |he compa|rison st|
|000012a0| 6f 70 70 65 64 20 61 74 | 20 74 68 65 20 61 6c 74 |opped at| the alt|
|000012b0| 65 72 61 74 69 6f 6e 2c | 0d 09 09 20 74 68 65 20 |eration,|... the |
|000012c0| 74 77 6f 20 6c 69 6e 65 | 73 20 61 72 65 20 69 64 |two line|s are id|
|000012d0| 65 6e 74 69 63 61 6c 2e | 20 20 2a 2f 0d 09 69 66 |entical.| */..if|
|000012e0| 20 28 74 32 20 3d 3d 20 | 73 32 2d 3e 74 65 78 74 | (t2 == |s2->text|
|000012f0| 20 2b 20 73 32 2d 3e 6c | 65 6e 67 74 68 20 2b 20 | + s2->l|ength + |
|00001300| 31 29 0d 09 09 72 65 74 | 75 72 6e 20 30 3b 0d 0d |1)...ret|urn 0;..|
|00001310| 09 72 65 74 75 72 6e 20 | 28 31 29 3b 0d 7d 0d 0d |.return |(1);.}..|
|00001320| 2f 2a 20 50 72 69 6e 74 | 20 69 6e 20 61 20 66 6f |/* Print| in a fo|
|00001330| 72 6d 61 74 20 73 6f 6d | 65 77 68 61 74 20 6c 69 |rmat som|ewhat li|
|00001340| 6b 65 20 65 64 20 63 6f | 6d 6d 61 6e 64 73 0d 09 |ke ed co|mmands..|
|00001350| 20 65 78 63 65 70 74 20 | 74 68 61 74 20 65 61 63 | except |that eac|
|00001360| 68 20 69 6e 73 65 72 74 | 20 63 6f 6d 6d 61 6e 64 |h insert| command|
|00001370| 20 73 74 61 74 65 73 20 | 74 68 65 20 6e 75 6d 62 | states |the numb|
|00001380| 65 72 20 6f 66 20 6c 69 | 6e 65 73 20 69 74 20 69 |er of li|nes it i|
|00001390| 6e 73 65 72 74 73 2e 0d | 09 20 54 68 69 73 20 66 |nserts..|. This f|
|000013a0| 6f 72 6d 61 74 20 69 73 | 20 75 73 65 64 20 66 6f |ormat is| used fo|
|000013b0| 72 20 52 43 53 2e 20 20 | 2a 2f 0d 0d 76 6f 69 64 |r RCS. |*/..void|
|000013c0| 0d 70 72 69 6e 74 5f 72 | 63 73 5f 73 63 72 69 70 |.print_r|cs_scrip|
|000013d0| 74 20 28 73 74 72 75 63 | 74 20 66 69 6c 65 5f 64 |t (struc|t file_d|
|000013e0| 61 74 61 20 2a 66 69 6c | 65 30 50 74 72 2c 20 73 |ata *fil|e0Ptr, s|
|000013f0| 74 72 75 63 74 20 66 69 | 6c 65 5f 64 61 74 61 20 |truct fi|le_data |
|00001400| 2a 66 69 6c 65 31 50 74 | 72 29 0d 7b 0d 09 63 68 |*file1Pt|r).{..ch|
|00001410| 61 72 09 09 09 09 09 09 | 09 09 09 09 63 6f 6d 6d |ar......|....comm|
|00001420| 61 6e 64 43 68 61 72 3b | 0d 09 72 65 67 69 73 74 |andChar;|..regist|
|00001430| 65 72 20 73 74 72 75 63 | 74 20 63 68 61 6e 67 65 |er struc|t change|
|00001440| 20 2a 68 75 6e 6b 50 74 | 72 3b 0d 09 73 74 72 75 | *hunkPt|r;..stru|
|00001450| 63 74 20 6c 69 6e 65 5f | 64 65 66 20 09 09 09 20 |ct line_|def ... |
|00001460| 2a 6c 61 73 74 4c 69 6e | 65 50 74 72 3b 0d 09 73 |*lastLin|ePtr;..s|
|00001470| 74 72 75 63 74 20 6c 69 | 6e 65 5f 64 65 66 20 09 |truct li|ne_def .|
|00001480| 09 09 20 2a 6c 69 6e 65 | 50 74 72 3b 0d 09 72 65 |.. *line|Ptr;..re|
|00001490| 67 69 73 74 65 72 20 69 | 6e 74 09 09 09 09 09 09 |gister i|nt......|
|000014a0| 6e 75 6d 62 65 72 4f 66 | 4c 69 6e 65 73 3b 0d 0d |numberOf|Lines;..|
|000014b0| 09 68 75 6e 6b 50 74 72 | 20 3d 20 66 69 6c 65 31 |.hunkPtr| = file1|
|000014c0| 50 74 72 2d 3e 73 63 72 | 69 70 74 50 74 72 3b 0d |Ptr->scr|iptPtr;.|
|000014d0| 09 69 66 20 28 68 75 6e | 6b 50 74 72 20 3d 3d 20 |.if (hun|kPtr == |
|000014e0| 4e 55 4c 4c 29 20 7b 0d | 09 09 69 66 20 28 66 69 |NULL) {.|..if (fi|
|000014f0| 6c 65 30 50 74 72 2d 3e | 62 75 66 66 65 72 20 3d |le0Ptr->|buffer =|
|00001500| 3d 20 4e 55 4c 4c 29 20 | 7b 0d 09 20 2f 2a 0d 09 |= NULL) |{.. /*..|
|00001510| 09 2a 20 46 69 6c 65 30 | 20 64 6f 65 73 6e 27 74 |.* File0| doesn't|
|00001520| 20 65 78 69 73 74 20 73 | 6f 20 61 64 64 20 61 6c | exist s|o add al|
|00001530| 6c 20 6f 66 20 66 69 6c | 65 20 31 2e 0d 09 09 2a |l of fil|e 1....*|
|00001540| 2f 0d 09 09 09 6e 75 6d | 62 65 72 4f 66 4c 69 6e |/....num|berOfLin|
|00001550| 65 73 20 3d 20 66 69 6c | 65 31 50 74 72 2d 3e 62 |es = fil|e1Ptr->b|
|00001560| 75 66 66 65 72 65 64 5f | 6c 69 6e 65 73 3b 0d 0d |uffered_|lines;..|
|00001570| 09 09 09 69 66 20 28 6e | 75 6d 62 65 72 4f 66 4c |...if (n|umberOfL|
|00001580| 69 6e 65 73 20 21 3d 20 | 30 29 20 7b 0d 09 09 09 |ines != |0) {....|
|00001590| 09 63 6f 6d 6d 61 6e 64 | 43 68 61 72 20 3d 20 27 |.command|Char = '|
|000015a0| 61 27 3b 0d 09 09 09 09 | 6c 69 6e 65 50 74 72 20 |a';.....|linePtr |
|000015b0| 3d 20 66 69 6c 65 31 50 | 74 72 2d 3e 6c 69 6e 62 |= file1P|tr->linb|
|000015c0| 75 66 3b 0d 09 09 09 09 | 6c 61 73 74 4c 69 6e 65 |uf;.....|lastLine|
|000015d0| 50 74 72 20 3d 20 6c 69 | 6e 65 50 74 72 20 2b 20 |Ptr = li|nePtr + |
|000015e0| 6e 75 6d 62 65 72 4f 66 | 4c 69 6e 65 73 20 2d 20 |numberOf|Lines - |
|000015f0| 31 3b 0d 09 09 09 09 69 | 66 20 28 6c 61 73 74 4c |1;.....i|f (lastL|
|00001600| 69 6e 65 50 74 72 2d 3e | 74 65 78 74 20 5b 6c 61 |inePtr->|text [la|
|00001610| 73 74 4c 69 6e 65 50 74 | 72 2d 3e 6c 65 6e 67 74 |stLinePt|r->lengt|
|00001620| 68 20 2d 20 31 5d 20 21 | 3d 20 27 5c 6e 27 29 0d |h - 1] !|= '\n').|
|00001630| 09 09 09 09 09 63 6f 6d | 6d 61 6e 64 43 68 61 72 |.....com|mandChar|
|00001640| 20 3d 20 27 41 27 3b 0d | 09 09 09 09 70 72 69 6e | = 'A';.|....prin|
|00001650| 74 66 20 28 22 25 63 30 | 20 25 64 5c 6e 22 2c 20 |tf ("%c0| %d\n", |
|00001660| 63 6f 6d 6d 61 6e 64 43 | 68 61 72 2c 20 6e 75 6d |commandC|har, num|
|00001670| 62 65 72 4f 66 4c 69 6e | 65 73 29 3b 09 09 09 09 |berOfLin|es);....|
|00001680| 09 09 0d 09 09 09 09 64 | 6f 20 7b 0d 09 09 09 09 |.......d|o {.....|
|00001690| 09 66 77 72 69 74 65 20 | 28 6c 69 6e 65 50 74 72 |.fwrite |(linePtr|
|000016a0| 2d 3e 74 65 78 74 2c 20 | 73 69 7a 65 6f 66 20 28 |->text, |sizeof (|
|000016b0| 63 68 61 72 29 2c 20 6c | 69 6e 65 50 74 72 2d 3e |char), l|inePtr->|
|000016c0| 6c 65 6e 67 74 68 2c 20 | 73 74 64 6f 75 74 29 3b |length, |stdout);|
|000016d0| 0d 09 09 09 09 09 6c 69 | 6e 65 50 74 72 20 2b 2b |......li|nePtr ++|
|000016e0| 3b 0d 09 09 09 09 09 6e | 75 6d 62 65 72 4f 66 4c |;......n|umberOfL|
|000016f0| 69 6e 65 73 20 2d 2d 3b | 0d 09 09 09 09 7d 20 77 |ines --;|.....} w|
|00001700| 68 69 6c 65 20 28 6e 75 | 6d 62 65 72 4f 66 4c 69 |hile (nu|mberOfLi|
|00001710| 6e 65 73 20 21 3d 20 30 | 29 3b 0d 09 09 09 09 69 |nes != 0|);.....i|
|00001720| 66 20 28 63 6f 6d 6d 61 | 6e 64 43 68 61 72 20 3d |f (comma|ndChar =|
|00001730| 3d 20 27 41 27 29 0d 09 | 09 09 09 09 70 75 74 63 |= 'A')..|....putc|
|00001740| 68 61 72 20 28 27 5c 6e | 27 29 3b 0d 09 09 09 7d |har ('\n|');....}|
|00001750| 0d 09 09 7d 0d 09 7d 20 | 65 6c 73 65 0d 09 09 77 |...}..} |else...w|
|00001760| 68 69 6c 65 20 28 68 75 | 6e 6b 50 74 72 29 0d 09 |hile (hu|nkPtr)..|
|00001770| 09 09 7b 0d 09 09 09 09 | 69 66 20 28 68 75 6e 6b |..{.....|if (hunk|
|00001780| 50 74 72 2d 3e 64 65 6c | 65 74 65 64 20 7c 7c 20 |Ptr->del|eted || |
|00001790| 68 75 6e 6b 50 74 72 2d | 3e 69 6e 73 65 72 74 65 |hunkPtr-|>inserte|
|000017a0| 64 29 20 7b 0d 0d 09 09 | 09 20 2f 2a 20 46 6f 72 |d) {....|. /* For|
|000017b0| 20 64 65 6c 65 74 69 6f | 6e 2c 20 70 72 69 6e 74 | deletio|n, print|
|000017c0| 20 6a 75 73 74 20 74 68 | 65 20 73 74 61 72 74 69 | just th|e starti|
|000017d0| 6e 67 20 6c 69 6e 65 20 | 6e 75 6d 62 65 72 20 66 |ng line |number f|
|000017e0| 72 6f 6d 20 66 69 6c 65 | 20 30 0d 09 09 09 09 09 |rom file| 0......|
|000017f0| 61 6e 64 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f |and the |number o|
|00001800| 66 20 6c 69 6e 65 73 20 | 64 65 6c 65 74 65 64 2e |f lines |deleted.|
|00001810| 09 2a 2f 0d 09 09 09 09 | 09 69 66 20 28 68 75 6e |.*/.....|.if (hun|
|00001820| 6b 50 74 72 2d 3e 64 65 | 6c 65 74 65 64 29 0d 09 |kPtr->de|leted)..|
|00001830| 09 09 09 09 09 70 72 69 | 6e 74 66 20 28 22 78 25 |.....pri|ntf ("x%|
|00001840| 64 20 25 64 5c 6e 22 2c | 20 68 75 6e 6b 50 74 72 |d %d\n",| hunkPtr|
|00001850| 2d 3e 6c 69 6e 65 30 20 | 2b 20 31 2c 20 68 75 6e |->line0 |+ 1, hun|
|00001860| 6b 50 74 72 2d 3e 64 65 | 6c 65 74 65 64 29 3b 09 |kPtr->de|leted);.|
|00001870| 09 09 0d 0d 09 09 09 20 | 2f 2a 20 54 61 6b 65 20 |....... |/* Take |
|00001880| 6c 61 73 74 2d 6c 69 6e | 65 2d 6e 75 6d 62 65 72 |last-lin|e-number|
|00001890| 20 66 72 6f 6d 20 66 69 | 6c 65 20 30 20 61 6e 64 | from fi|le 0 and|
|000018a0| 20 23 20 6c 69 6e 65 73 | 20 66 72 6f 6d 20 66 69 | # lines| from fi|
|000018b0| 6c 65 20 31 2e 09 2a 2f | 0d 09 09 09 09 09 6e 75 |le 1..*/|......nu|
|000018c0| 6d 62 65 72 4f 66 4c 69 | 6e 65 73 20 3d 20 68 75 |mberOfLi|nes = hu|
|000018d0| 6e 6b 50 74 72 2d 3e 69 | 6e 73 65 72 74 65 64 3b |nkPtr->i|nserted;|
|000018e0| 0d 09 09 09 09 09 69 66 | 20 28 68 75 6e 6b 50 74 |......if| (hunkPt|
|000018f0| 72 2d 3e 69 6e 73 65 72 | 74 65 64 20 21 3d 20 30 |r->inser|ted != 0|
|00001900| 29 0d 09 09 09 09 09 09 | 7b 0d 09 09 09 09 09 09 |).......|{.......|
|00001910| 09 63 6f 6d 6d 61 6e 64 | 43 68 61 72 20 3d 20 27 |.command|Char = '|
|00001920| 61 27 3b 0d 09 09 09 09 | 09 09 09 6c 69 6e 65 50 |a';.....|...lineP|
|00001930| 74 72 20 3d 20 26 66 69 | 6c 65 31 50 74 72 2d 3e |tr = &fi|le1Ptr->|
|00001940| 6c 69 6e 62 75 66 5b 68 | 75 6e 6b 50 74 72 2d 3e |linbuf[h|unkPtr->|
|00001950| 6c 69 6e 65 31 5d 3b 0d | 09 09 09 09 09 09 09 6c |line1];.|.......l|
|00001960| 61 73 74 4c 69 6e 65 50 | 74 72 20 3d 20 6c 69 6e |astLineP|tr = lin|
|00001970| 65 50 74 72 20 2b 20 6e | 75 6d 62 65 72 4f 66 4c |ePtr + n|umberOfL|
|00001980| 69 6e 65 73 20 2d 20 31 | 3b 0d 09 09 09 09 09 09 |ines - 1|;.......|
|00001990| 09 69 66 20 28 6c 61 73 | 74 4c 69 6e 65 50 74 72 |.if (las|tLinePtr|
|000019a0| 2d 3e 74 65 78 74 20 5b | 6c 61 73 74 4c 69 6e 65 |->text [|lastLine|
|000019b0| 50 74 72 2d 3e 6c 65 6e | 67 74 68 20 2d 20 31 5d |Ptr->len|gth - 1]|
|000019c0| 20 21 3d 20 27 5c 6e 27 | 29 0d 09 09 09 09 09 09 | != '\n'|).......|
|000019d0| 09 09 63 6f 6d 6d 61 6e | 64 43 68 61 72 20 3d 20 |..comman|dChar = |
|000019e0| 27 41 27 3b 0d 0d 09 09 | 09 09 09 09 09 70 72 69 |'A';....|.....pri|
|000019f0| 6e 74 66 20 28 22 25 63 | 25 64 20 25 64 5c 6e 22 |ntf ("%c|%d %d\n"|
|00001a00| 2c 20 63 6f 6d 6d 61 6e | 64 43 68 61 72 2c 20 68 |, comman|dChar, h|
|00001a10| 75 6e 6b 50 74 72 2d 3e | 6c 69 6e 65 30 20 2b 20 |unkPtr->|line0 + |
|00001a20| 68 75 6e 6b 50 74 72 2d | 3e 64 65 6c 65 74 65 64 |hunkPtr-|>deleted|
|00001a30| 2c 20 6e 75 6d 62 65 72 | 4f 66 4c 69 6e 65 73 29 |, number|OfLines)|
|00001a40| 3b 09 09 09 09 09 0d 0d | 09 09 09 09 09 09 09 2f |;.......|......./|
|00001a50| 2a 20 50 72 69 6e 74 20 | 74 68 65 20 69 6e 73 65 |* Print |the inse|
|00001a60| 72 74 65 64 20 6c 69 6e | 65 73 2e 09 2a 2f 0d 09 |rted lin|es..*/..|
|00001a70| 09 09 09 09 09 09 64 6f | 20 7b 0d 09 09 09 09 09 |......do| {......|
|00001a80| 09 09 09 66 77 72 69 74 | 65 20 28 6c 69 6e 65 50 |...fwrit|e (lineP|
|00001a90| 74 72 2d 3e 74 65 78 74 | 2c 20 73 69 7a 65 6f 66 |tr->text|, sizeof|
|00001aa0| 20 28 63 68 61 72 29 2c | 20 6c 69 6e 65 50 74 72 | (char),| linePtr|
|00001ab0| 2d 3e 6c 65 6e 67 74 68 | 2c 20 73 74 64 6f 75 74 |->length|, stdout|
|00001ac0| 29 3b 0d 09 09 09 09 09 | 09 09 09 6c 69 6e 65 50 |);......|...lineP|
|00001ad0| 74 72 20 2b 2b 3b 0d 09 | 09 09 09 09 09 09 09 6e |tr ++;..|.......n|
|00001ae0| 75 6d 62 65 72 4f 66 4c | 69 6e 65 73 20 2d 2d 3b |umberOfL|ines --;|
|00001af0| 0d 09 09 09 09 09 09 09 | 7d 20 77 68 69 6c 65 20 |........|} while |
|00001b00| 28 6e 75 6d 62 65 72 4f | 66 4c 69 6e 65 73 20 21 |(numberO|fLines !|
|00001b10| 3d 20 30 29 3b 0d 09 09 | 09 09 09 09 09 69 66 20 |= 0);...|.....if |
|00001b20| 28 63 6f 6d 6d 61 6e 64 | 43 68 61 72 20 3d 3d 20 |(command|Char == |
|00001b30| 27 41 27 29 0d 09 09 09 | 09 09 09 09 09 70 75 74 |'A')....|.....put|
|00001b40| 63 68 61 72 20 28 27 5c | 6e 27 29 3b 0d 09 09 09 |char ('\|n');....|
|00001b50| 09 09 09 7d 0d 09 09 09 | 09 7d 0d 09 09 09 09 68 |...}....|.}.....h|
|00001b60| 75 6e 6b 50 74 72 20 3d | 20 68 75 6e 6b 50 74 72 |unkPtr =| hunkPtr|
|00001b70| 2d 3e 6c 69 6e 6b 3b 0d | 09 09 20 7d 0d 7d 0d 0d |->link;.|.. }.}..|
|00001b80| 76 6f 69 64 0d 52 65 6d | 6f 76 65 4e 61 6d 65 53 |void.Rem|oveNameS|
|00001b90| 75 66 66 69 78 20 28 63 | 68 61 72 20 2a 6e 61 6d |uffix (c|har *nam|
|00001ba0| 65 50 74 72 29 0d 7b 0d | 09 63 68 61 72 20 2a 73 |ePtr).{.|.char *s|
|00001bb0| 75 66 66 69 78 50 74 72 | 3b 0d 0d 09 73 75 66 66 |uffixPtr|;...suff|
|00001bc0| 69 78 50 74 72 20 3d 20 | 73 74 72 72 63 68 72 20 |ixPtr = |strrchr |
|00001bd0| 28 6e 61 6d 65 50 74 72 | 2c 20 44 49 52 45 43 54 |(namePtr|, DIRECT|
|00001be0| 4f 52 59 5f 43 48 41 52 | 29 3b 0d 09 69 66 20 28 |ORY_CHAR|);..if (|
|00001bf0| 73 75 66 66 69 78 50 74 | 72 20 3d 3d 20 4e 55 4c |suffixPt|r == NUL|
|00001c00| 4c 29 0d 09 09 73 75 66 | 66 69 78 50 74 72 20 3d |L)...suf|fixPtr =|
|00001c10| 20 6e 61 6d 65 50 74 72 | 3b 0d 09 2a 73 75 66 66 | namePtr|;..*suff|
|00001c20| 69 78 50 74 72 20 3d 20 | 27 5c 30 27 3b 0d 7d 0d |ixPtr = |'\0';.}.|
|00001c30| 0d 2f 2a 20 6d 61 6c 6c | 6f 63 20 61 20 62 6c 6f |./* mall|oc a blo|
|00001c40| 63 6b 20 6f 66 20 6d 65 | 6d 6f 72 79 2c 20 77 69 |ck of me|mory, wi|
|00001c50| 74 68 20 66 61 74 61 6c | 20 65 72 72 6f 72 20 6d |th fatal| error m|
|00001c60| 65 73 73 61 67 65 20 69 | 66 20 77 65 20 63 61 6e |essage i|f we can|
|00001c70| 27 74 20 64 6f 20 69 74 | 2e 20 2a 2f 0d 0d 76 6f |'t do it|. */..vo|
|00001c80| 69 64 20 2a 0d 78 6d 61 | 6c 6c 6f 63 20 28 73 69 |id *.xma|lloc (si|
|00001c90| 7a 65 5f 74 20 73 69 7a | 65 29 0d 7b 0d 09 72 65 |ze_t siz|e).{..re|
|00001ca0| 67 69 73 74 65 72 20 76 | 6f 69 64 20 2a 76 61 6c |gister v|oid *val|
|00001cb0| 75 65 3b 0d 0d 09 2f 2a | 0d 09 20 2a 20 20 4d 50 |ue;.../*|.. * MP|
|00001cc0| 57 20 72 65 61 6c 6c 6f | 63 20 72 65 74 75 72 6e |W reallo|c return|
|00001cd0| 73 20 61 20 6d 65 6d 6f | 72 79 20 65 72 72 6f 72 |s a memo|ry error|
|00001ce0| 20 77 68 65 6e 20 61 20 | 73 69 7a 65 20 6f 66 20 | when a |size of |
|00001cf0| 30 20 69 73 20 72 65 71 | 75 65 73 74 65 64 0d 09 |0 is req|uested..|
|00001d00| 20 2a 2f 0d 09 69 66 20 | 28 73 69 7a 65 20 3d 3d | */..if |(size ==|
|00001d10| 20 30 29 0d 09 09 73 69 | 7a 65 20 3d 20 31 3b 0d | 0)...si|ze = 1;.|
|00001d20| 09 76 61 6c 75 65 20 3d | 20 6d 61 6c 6c 6f 63 20 |.value =| malloc |
|00001d30| 28 73 69 7a 65 29 3b 0d | 0d 09 69 66 20 28 76 61 |(size);.|..if (va|
|00001d40| 6c 75 65 20 3d 3d 20 4e | 55 4c 4c 29 0d 09 09 45 |lue == N|ULL)...E|
|00001d50| 72 72 6f 72 20 28 4d 45 | 4d 4f 52 59 5f 45 52 52 |rror (ME|MORY_ERR|
|00001d60| 4f 52 29 3b 0d 09 72 65 | 74 75 72 6e 20 76 61 6c |OR);..re|turn val|
|00001d70| 75 65 3b 0d 7d 0d 0d 2f | 2a 20 72 65 61 6c 6c 6f |ue;.}../|* reallo|
|00001d80| 63 20 61 20 62 6c 6f 63 | 6b 20 6f 66 20 6d 65 6d |c a bloc|k of mem|
|00001d90| 6f 72 79 2c 20 77 69 74 | 68 20 66 61 74 61 6c 20 |ory, wit|h fatal |
|00001da0| 65 72 72 6f 72 20 6d 65 | 73 73 61 67 65 20 69 66 |error me|ssage if|
|00001db0| 20 77 65 20 63 61 6e 27 | 74 20 64 6f 20 69 74 2e | we can'|t do it.|
|00001dc0| 20 2a 2f 0d 0d 76 6f 69 | 64 20 2a 0d 78 72 65 61 | */..voi|d *.xrea|
|00001dd0| 6c 6c 6f 63 20 28 76 6f | 69 64 20 2a 6f 6c 64 2c |lloc (vo|id *old,|
|00001de0| 20 73 69 7a 65 5f 74 20 | 73 69 7a 65 29 0d 7b 0d | size_t |size).{.|
|00001df0| 09 72 65 67 69 73 74 65 | 72 20 76 6f 69 64 20 2a |.registe|r void *|
|00001e00| 76 61 6c 75 65 3b 0d 0d | 09 2f 2a 0d 09 20 2a 20 |value;..|./*.. * |
|00001e10| 20 4d 50 57 20 72 65 61 | 6c 6c 6f 63 20 72 65 74 | MPW rea|lloc ret|
|00001e20| 75 72 6e 73 20 61 20 6d | 65 6d 6f 72 79 20 65 72 |urns a m|emory er|
|00001e30| 72 6f 72 20 77 68 65 6e | 20 61 20 73 69 7a 65 20 |ror when| a size |
|00001e40| 6f 66 20 30 20 69 73 20 | 72 65 71 75 65 73 74 65 |of 0 is |requeste|
|00001e50| 64 0d 09 20 2a 2f 0d 09 | 69 66 20 28 73 69 7a 65 |d.. */..|if (size|
|00001e60| 20 3d 3d 20 30 29 0d 09 | 09 73 69 7a 65 20 3d 20 | == 0)..|.size = |
|00001e70| 31 3b 0d 09 76 61 6c 75 | 65 20 3d 20 72 65 61 6c |1;..valu|e = real|
|00001e80| 6c 6f 63 20 28 6f 6c 64 | 2c 20 73 69 7a 65 29 3b |loc (old|, size);|
|00001e90| 0d 0d 09 69 66 20 28 76 | 61 6c 75 65 20 3d 3d 20 |...if (v|alue == |
|00001ea0| 4e 55 4c 4c 29 0d 09 09 | 45 72 72 6f 72 20 28 4d |NULL)...|Error (M|
|00001eb0| 45 4d 4f 52 59 5f 45 52 | 52 4f 52 29 3b 0d 09 72 |EMORY_ER|ROR);..r|
|00001ec0| 65 74 75 72 6e 20 76 61 | 6c 75 65 3b 0d 7d 0d 0d |eturn va|lue;.}..|
|00001ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f00| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00001f10| 65 72 52 50 74 72 54 79 | 70 65 29 20 74 6f 41 63 |erRPtrTy|pe) toAc|
|00001f20| 74 69 76 65 4d 61 70 29 | 3b 09 09 09 09 09 09 09 |tiveMap)|;.......|
|00001f30| 06 75 74 69 6c 2e 63 75 | 02 00 00 00 54 45 58 54 |.util.cu|....TEXT|
|00001f40| 4d 50 53 20 01 00 01 86 | 02 40 00 00 00 00 5d 25 |MPS ....|.@....]%|
|00001f50| 00 00 54 45 58 54 4d 50 | 53 20 01 00 01 86 02 40 |..TEXTMP|S .....@|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f70| 00 00 ad 61 d5 4b 00 00 | 1e 50 00 00 01 ac 09 45 |...a.K..|.P.....E|
|00001f80| 43 5f 54 4f 5f 50 52 45 | 50 5f 49 56 53 5f 4f 46 |C_TO_PRE|P_IVS_OF|
|00001f90| 20 28 47 2e 6f 62 6a 65 | 63 74 53 74 6f 72 65 2e | (G.obje|ctStore.|
|00001fa0| 74 68 65 44 6f 63 4f 62 | 6a 65 63 74 2c 20 44 6f |theDocOb|ject, Do|
|00001fb0| 63 4f 62 6a 65 63 74 56 | 29 2d 3e 77 68 65 72 65 |cObjectV|)->where|
|00001fc0| 53 61 76 65 64 4d 61 70 | 20 3d 20 77 68 65 72 65 |SavedMap| = where|
|00001fd0| 53 61 76 65 64 3b 0d 7d | 09 2f 2a 09 45 43 53 61 |Saved;.}|./*.ECSa|
|00001fe0| 76 65 09 2a 2f 09 0d 0d | 23 69 66 64 65 66 20 44 |ve.*/...|#ifdef D|
|00001ff0| 46 5f 4d 41 43 48 49 4e | 45 5f 4d 41 43 49 4e 54 |F_MACHIN|E_MACINT|
|00002000| 00 00 00 1e 00 27 00 00 | 02 ff 02 20 00 27 00 00 |.....'..|... .'..|
|00002010| 02 ff 02 20 00 00 00 00 | 00 00 00 00 00 00 00 00 |... ....|........|
|00002020| 00 00 00 00 00 48 00 08 | 53 65 71 75 6f 79 61 68 |.....H..|Sequoyah|
|00002030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002040| 00 00 00 00 00 00 00 00 | 00 03 00 02 00 56 00 00 |........|.....V..|
|00002050| 02 fc 02 20 00 56 00 00 | 02 fc 02 20 aa 37 4a 1e |... .V..|... .7J.|
|00002060| 00 00 00 96 00 00 00 96 | 00 00 00 00 01 00 00 00 |........|........|
|00002070| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 02 24 |.....n..|.n...>.$|
|00002080| 72 18 12 5e 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |r..^....|.>..MPSR|
|00002090| 00 01 00 0a 03 f0 ff ff | 00 00 00 00 00 00 00 00 |........|........|
|000020a0| 03 ed ff ff 00 00 00 22 | 00 00 00 00 00 00 00 00 |......."|........|
|000020b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+